<template>
  <div id="markdown">
    <mavon-editor v-model="initContent" @save="save"/>
  </div>
</template>


<script>
  //npm install mavon-editor --save
  //https://www.jianshu.com/p/04376d0c9ff1

  import Vue from 'vue'
  import mavonEditor from 'mavon-editor'
  import 'mavon-editor/dist/css/index.css'

  Vue.use(mavonEditor);

  import axios from 'axios'
  import qs from "qs";


  export default {
    //数据类型
    data() {
      return {
        initContent: ""
      }
    },
    //在components中引入子组件
    components: {},
    //初始化加载
    mounted: function () {
      this.findEntity();
    },
    //具体js方法
    methods: {
      findEntity() {
       this.initContent  = "# 初始化";
      },
      save(value, render) {
        console.log("value:", value);
        console.log("render:", render);
        const params = {
          content: value
        };

      }
    }
  }
</script>


<style scoped>


</style>
